<?php

class Form_Admin_Lead extends Form_Custom_General {

    public function init() {
		
		$lead_name = $this->createElement("text", "lead_name")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter Lead name")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Lead Name"));
        $this->addElement($lead_name);
		
		$lead_main_status = $this->createElement("select", "lead_main_status")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($lead_main_status);
		
		$lead_description = $this->createElement("textarea", "lead_description")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","cols" => "15", "rows" => "4","placeholder"=>"Lead Description"));
        $this->addElement($lead_description);
		
		$lead_currency = $this->createElement("select", "lead_currency")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>""));
        $this->addElement($lead_currency);
		
		$lead_opportunity = $this->createElement("text", "lead_opportunity")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Opportunity"));
        $this->addElement($lead_opportunity);
		
		$lead_source = $this->createElement("select", "lead_source")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"","placeholder"=>""));
        $this->addElement($lead_source);
		
		$lead_source_description = $this->createElement("textarea", "lead_source_description")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","cols" => "15", "rows" => "4","placeholder"=>"Lead Source Description"));
        $this->addElement($lead_source_description);
		
		$lead_responsible = $this->createElement("text", "lead_responsible")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>""));
        $this->addElement($lead_responsible);
		
		$lead_available_to_all = $this->createElement("text", "lead_available_to_all")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>""));
        $this->addElement($lead_available_to_all);
		
		$lead_contact_name = $this->createElement("text", "lead_contact_name")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Contact Name"));
        $this->addElement($lead_contact_name);
		
		$lead_firstname = $this->createElement("text", "lead_firstname")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter first name")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"First Name"));
        $this->addElement($lead_firstname);
		
		$lead_middlename = $this->createElement("text", "lead_middlename")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Middle Name"));
        $this->addElement($lead_middlename);
		
		$lead_lastname = $this->createElement("text", "lead_lastname")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter last name")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Last Name"));
        $this->addElement($lead_lastname);
		
		$lead_dob = $this->createElement("text", "lead_dob")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter date of birth")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control form_datetime","placeholder"=>"",'readonly' => 'true'));
        $this->addElement($lead_dob);
		
		$lead_email = $this->createElement('text', 'lead_email')
                ->setRequired(TRUE)
                ->addValidator('NotEmpty', true, array('messages' => array('isEmpty' => 'Email address should not be blank.')))
                ->addValidator(new Zend_Validate_EmailAddress())
                ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                    new Zend_Filter_StringToLower()
                ))
                ->setAttribs(Array('class' => "form-control"));
        $lead_email->getValidator('emailAddress')->setMessage("Email address is not valid.", Zend_Validate_EmailAddress::INVALID_FORMAT);
        $this->addElement($lead_email);
		
		$lead_phone = $this->createElement("text", "lead_phone")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter phone number")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Phone Number"));
        $this->addElement($lead_phone);
		
		$lead_site = $this->createElement("text", "lead_site")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Site"));
        $this->addElement($lead_site);
		
		$lead_company_name = $this->createElement("text", "lead_company_name")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Company"));
        $this->addElement($lead_company_name);
		
		$lead_position = $this->createElement("text", "lead_position")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Client Position"));
        $this->addElement($lead_position);
		
		$lead_adrline1 = $this->createElement("text", "lead_adrline1")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Adrline1"));
        $this->addElement($lead_adrline1);
		
		$lead_adrline2 = $this->createElement("text", "lead_adrline2")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Adrline2"));
        $this->addElement($lead_adrline2);

		$lead_adrline3 = $this->createElement("text", "lead_adrline3")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Adrline3"));
        $this->addElement($lead_adrline3);
		
		$lead_street = $this->createElement("text", "lead_street")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Street"));
        $this->addElement($lead_street);
		
		$lead_postal = $this->createElement("text", "lead_postal")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Postal"));
        $this->addElement($lead_postal);
		
		$lead_city = $this->createElement("text", "lead_city")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"City"));
        $this->addElement($lead_city);
		
		$lead_country = $this->createElement("text", "lead_country")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Country"));
        $this->addElement($lead_country);
		
		$lead_comment = $this->createElement("textarea", "lead_comment")
				->setRequired(FALSE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "r")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","cols" => "15", "rows" => "4","placeholder"=>"Comment"));
        $this->addElement($lead_comment);
		
		$lead_addedby = $this->createElement('text', 'lead_addedby')
               ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array('class' => "form-control", "readonly"=>"readonly", "placeholder" => ""));
        $this->addElement($lead_addedby);
        
        $lead_updatedby = $this->createElement('text', 'lead_updatedby')
               ->addFilters(array(
                    new Zend_Filter_StringTrim(),
                ))
                ->setAttribs(Array('class' => "form-control","readonly"=>"readonly", "placeholder" => ""));
        $this->addElement($lead_updatedby);
		
		$lead_status = $this->createElement("select", "lead_status")
				->setRequired(TRUE)
				->addValidator("NotEmpty", true, array("messages" => array("isEmpty" => "Please enter status")))
				->addFilters(array(
					 new Zend_Filter_StringTrim(),
				))
				->setAttribs(Array("class"=>"form-control","placeholder"=>"Status"));
		$this->addElement($lead_status);
		
		$submit = $this->createElement('submit', 'Save')
                ->setAttribs(Array('title' => "Save changes", 'class' => "btn-glow primary"));
        $this->addElement($submit);

        $reset = $this->createElement('reset', 'Reset')
                ->setAttribs(Array('title' => "Save changes and continue to edit", 'class' => "btn-glow primary"));
        $this->addElement($reset);
    }
}